/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication3;
import java.awt.BorderLayout;
import javax.swing.*;
import org.jdesktop.swingx.JXCollapsiblePane;
import org.jdesktop.swingx.JXFrame;
import org.jdesktop.swingx.JXList;
import org.jdesktop.swingx.JXLoginPane;
import org.jdesktop.swingx.JXPanel;
/**
 *
 * @author Oscar
 */
public class MainPage {
    public static void main(String[] args){
        JXFrame frame=new JXFrame("Illusion");
frame.setLayout(new BorderLayout());
 JXCollapsiblePane cp1 = new JXCollapsiblePane();
 String[] data={"ola", "adios"};
 JXList login= new JXList(data);
 cp1.add(login);
 JXCollapsiblePane cp2 = new JXCollapsiblePane(new BorderLayout());

 JPanel online= new JPanel(new BorderLayout());
 JLabel on= new JLabel("Online");
 online.add("North", on);
 String[] onlineu={"John                         ", "Sarah                                   "};
 JList onl= new JList(onlineu);
 
 online.add("South", onl);
 cp2.add("North", online);
 JPanel offline= new JPanel(new BorderLayout());
 JLabel off= new JLabel("Offline");
 offline.add("North", off);
 String[] offlineu={"Adam                        ", "Sally                                     "};
 JList ofl= new JList(offlineu);
 offline.add("South", ofl);
 cp2.add("South", offline);

//frame.add("South", cp2);

JXPanel down= new JXPanel(new BorderLayout());

JXPanel downhigh= new JXPanel(new BorderLayout());
downhigh.add("West", cp1);
downhigh.add("East", cp2);
down.add("North", downhigh);
JXPanel panel= new JXPanel(new BorderLayout());
JButton log= new JButton("Login");
log.setContentAreaFilled(false);
log.setBorderPainted(false);
panel.add("West", login);
JPanel auxiliar= new JPanel(new BorderLayout());
JButton buddies= new JButton("Buddies");
buddies.setContentAreaFilled(false);
buddies.setBorderPainted(false);
buddies.setAction(cp2.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
auxiliar.add("West", buddies);

JLabel state= new JLabel("state");
auxiliar.add("East", state);
panel.add("East", auxiliar);
down.add("South", panel);
frame.add("South", down);

 frame.setSize(800,800);
 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 frame.pack();
 frame.setVisible(true);}

}
